Dxl error

Hi!!can anyone help me for correcting the following script? I am trying to extract the members of the citrix groups and i want to fill in the attributes.The script is working good sometimes but when i am selecting more objects,it's showing me the "unknown software exception" error which i have notified in the attached file.Please verify the program and help me.. Thank you for your support!
string result = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-Users -gc", result, -1 )
string user_cn = result0: (length( result ) -3 )

string result2 = ""
string cmd2 = "dsget group -members " user_cn
win32SystemWait_ ( cmd2, result2, -1 )

string res1 = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-TestUsers -gc", res1, -1 )
string user_cn1 = res10: (length( res1 ) -3 )

string res2 = ""
string cmd3 = "dsget group -members " user_cn1
win32SystemWait_ ( cmd3, res2, -1 )
string resmg = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-DBMgr -gc", resmg, -1 )
string user_cn2 = resmg0: (length( resmg ) -3 )

string resmg2 = ""
string cmd4 = "dsget group -members " user_cn2
win32SystemWait_ ( cmd4, resmg2, -1 )

string res_ept = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-ExerptUsers -gc", res_ept, -1 )
string user_cn3 = res_ept0: (length( res_ept ) -3 )

string res_ept2 = ""
string cmd5 = "dsget group -members " user_cn3
win32SystemWait_ ( cmd5, res_ept2, -1 )
Module m
current=folder("/Admin/User Mgt")
m=edit("DOORS_UsersList",true)

Object o, startObj, endObj

getSelection(m,startObj, endObj)

if (!null startObj)
{
pragma runLim,0
int nos=0

for o in m do nos++

progressStart(dbExplorer, "Updating UserList from Global Directory","something" ,nos) //progress bar

nos = 0

while(!null startObj && isSelected startObj)
{
o = startObj
startObj = next(startObj)

bool virtual=o."_j_virtual"
string global=o."_j_Global ID"
string h=number(o)

progressStep ++nos

progressMessage " object " h " global id = " global

if (matches(global,result2))
{
o."_j_A-700-DL-APP-DOORS-Users"="1"
progressMessage "updating doors users"
}
else
{
progressMessage "updating doors users"
o."_j_A-700-DL-APP-DOORS-Users"="0"
}
if (matches(global,res2))
{
progressMessage "updating doors test users"
o."_j_A-700-DL-APP-DOORS-TestUsers"="1"
}
else
{
progressMessage "updating doors test users"
o."_j_A-700-DL-APP-DOORS-TestUsers"="0"
}
if (matches(global,resmg2))
{
progressMessage "updating doors DBMgr "
o."_j_A-700-DL-APP-DOORS-DBMgr"="1"
}
else
{
progressMessage "updating doors DBMgr"
o."_j_A-700-DL-APP-DOORS-DBMgr"="0"
}
if (matches(global,resmg2))
{
progressMessage "updating doors ExerptUsers"
o."_j_A-700-DL-APP-DOORS-ExerptUsers"="1"
}
else
{
progressMessage "updating doors ExerptUsers"
o."_j_A-700-DL-APP-DOORS-ExerptUsers"="0"
}

int j,k;for (j=0;j<1000;j++) k=j*2-3
if (progressCancelled)
{
if (confirm("Exit loop?"))
{
progressStop
halt
}

}
}

}
else
{
warningBox ("No object selected,please select objects")
}

progressStop
kavitharassou - Tue Jul 17 10:07:39 EDT 2012

Re: Dxl error
llandale - Wed Jul 18 12:01:04 EDT 2012

I guess the issue is in all those "Progress" commands. You seem to be flooding the display GUI with updates coming at the speed of greased lightening. Comment them all out and try again.

Please re-post the code surrounded by {code} so it looks readable.
Makes it look like this:

if (whatever) {
   bla
   while loop {
      ddd
   }
}


rather than this:
if (whatever) {
bla
while loop {
ddd
}
}
Here are some nit observations:

 

  • If the exception doesn't provide a line number then some print statements that do not end in "\n" may help track it down.
  • If I read this right the object loop part of this code should take a fraction of a second; the Progress bar is useless.
  • Opening the module Exclusive and THEN checking selection doesn't make sense; I think it may load a view and disrupt the user's selected objects. For one thing, if you do open the module then this script will update the 1st object therein, since it is "selected" by default. I think this is a lot better routine at the top of most scripts:
    • Module m = current
    • if (null m or !isEdit(m) or name(m) != "DOORS_UsersList") then {complain, halt}
  • I doubt it matters, but the pragma is better near the top. Putting it inside a loop makes it appear it is doing something during program execution.
  • Define constants for you Attribute names.


-Louie

 

Re: Dxl error
kavitharassou - Fri Jul 20 06:01:56 EDT 2012

llandale - Wed Jul 18 12:01:04 EDT 2012

I guess the issue is in all those "Progress" commands. You seem to be flooding the display GUI with updates coming at the speed of greased lightening. Comment them all out and try again.

Please re-post the code surrounded by {code} so it looks readable.
Makes it look like this:

if (whatever) {
   bla
   while loop {
      ddd
   }
}


rather than this:
if (whatever) {
bla
while loop {
ddd
}
}
Here are some nit observations:

 

  • If the exception doesn't provide a line number then some print statements that do not end in "\n" may help track it down.
  • If I read this right the object loop part of this code should take a fraction of a second; the Progress bar is useless.
  • Opening the module Exclusive and THEN checking selection doesn't make sense; I think it may load a view and disrupt the user's selected objects. For one thing, if you do open the module then this script will update the 1st object therein, since it is "selected" by default. I think this is a lot better routine at the top of most scripts:
    • Module m = current
    • if (null m or !isEdit(m) or name(m) != "DOORS_UsersList") then {complain, halt}
  • I doubt it matters, but the pragma is better near the top. Putting it inside a loop makes it appear it is doing something during program execution.
  • Define constants for you Attribute names.


-Louie

 

string result = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-Users -gc", result, -1 )
string user_cn = result0: (length( result ) -3 )

string result2 = ""
string cmd2 = "dsget group -members " user_cn
win32SystemWait_ ( cmd2, result2, -1 )

string res1 = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-TestUsers -gc", res1, -1 )
string user_cn1 = res10: (length( res1 ) -3 )

string res2 = ""
string cmd3 = "dsget group -members " user_cn1
win32SystemWait_ ( cmd3, res2, -1 )
string resmg = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-DBMgr -gc", resmg, -1 )
string user_cn2 = resmg0: (length( resmg ) -3 )

string resmg2 = ""
string cmd4 = "dsget group -members " user_cn2
win32SystemWait_ ( cmd4, resmg2, -1 )

string res_ept = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-ExerptUsers -gc", res_ept, -1 )
string user_cn3 = res_ept0: (length( res_ept ) -3 )

string res_ept2 = ""
string cmd5 = "dsget group -members " user_cn3
win32SystemWait_ ( cmd5, res_ept2, -1 )
Module m =current

Object o, startObj, endObj

getSelection(m,startObj, endObj)

if (!null startObj)
{

while(!null startObj && isSelected startObj)
{
o = startObj
startObj = next(startObj)

bool virtual=o."_j_virtual"
string global=o."_j_Global ID"
string h=number(o)
if (matches(global,result2))
{
o."_j_A-700-DL-APP-DOORS-Users"="1"

}
else
{

o."_j_A-700-DL-APP-DOORS-Users"="0"
}
if (matches(global,res2))
{

o."_j_A-700-DL-APP-DOORS-TestUsers"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-TestUsers"="0"
}
if (matches(global,resmg2))
{

o."_j_A-700-DL-APP-DOORS-DBMgr"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-DBMgr"="0"
}
if (matches(global,resmg2))
{

o."_j_A-700-DL-APP-DOORS-ExerptUsers"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-ExerptUsers"="0"
}
}

}
else
{
warningBox ("No object selected,please select objects")
}
Hi!! thank you for your support.I hope now the code looks readable.I agree that the progress bar is useless here.I don't see anything when i run this script.so that i removed it.But still no changes in the output.It always shows me the same error when i am selecting more then 20 objects.

Re: Dxl error
kavitharassou - Fri Jul 20 06:06:36 EDT 2012

kavitharassou - Fri Jul 20 06:01:56 EDT 2012
string result = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-Users -gc", result, -1 )
string user_cn = result0: (length( result ) -3 )

string result2 = ""
string cmd2 = "dsget group -members " user_cn
win32SystemWait_ ( cmd2, result2, -1 )

string res1 = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-TestUsers -gc", res1, -1 )
string user_cn1 = res10: (length( res1 ) -3 )

string res2 = ""
string cmd3 = "dsget group -members " user_cn1
win32SystemWait_ ( cmd3, res2, -1 )
string resmg = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-DBMgr -gc", resmg, -1 )
string user_cn2 = resmg0: (length( resmg ) -3 )

string resmg2 = ""
string cmd4 = "dsget group -members " user_cn2
win32SystemWait_ ( cmd4, resmg2, -1 )

string res_ept = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-ExerptUsers -gc", res_ept, -1 )
string user_cn3 = res_ept0: (length( res_ept ) -3 )

string res_ept2 = ""
string cmd5 = "dsget group -members " user_cn3
win32SystemWait_ ( cmd5, res_ept2, -1 )
Module m =current

Object o, startObj, endObj

getSelection(m,startObj, endObj)

if (!null startObj)
{

while(!null startObj && isSelected startObj)
{
o = startObj
startObj = next(startObj)

bool virtual=o."_j_virtual"
string global=o."_j_Global ID"
string h=number(o)
if (matches(global,result2))
{
o."_j_A-700-DL-APP-DOORS-Users"="1"

}
else
{

o."_j_A-700-DL-APP-DOORS-Users"="0"
}
if (matches(global,res2))
{

o."_j_A-700-DL-APP-DOORS-TestUsers"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-TestUsers"="0"
}
if (matches(global,resmg2))
{

o."_j_A-700-DL-APP-DOORS-DBMgr"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-DBMgr"="0"
}
if (matches(global,resmg2))
{

o."_j_A-700-DL-APP-DOORS-ExerptUsers"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-ExerptUsers"="0"
}
}

}
else
{
warningBox ("No object selected,please select objects")
}
Hi!! thank you for your support.I hope now the code looks readable.I agree that the progress bar is useless here.I don't see anything when i run this script.so that i removed it.But still no changes in the output.It always shows me the same error when i am selecting more then 20 objects.

Please find the code in the attachement.when i do copy paste its not looking good
Attachments

attachment_14866604_citrix.dxl

Re: Dxl error
kavitharassou - Fri Jul 20 06:10:32 EDT 2012

kavitharassou - Fri Jul 20 06:06:36 EDT 2012
Please find the code in the attachement.when i do copy paste its not looking good

Please do not consider my last post.here is the code in attachement.
Attachments

attachment_14866606_citrix.dxl

Re: Dxl error
llandale - Fri Jul 20 09:54:33 EDT 2012

kavitharassou - Fri Jul 20 06:01:56 EDT 2012
string result = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-Users -gc", result, -1 )
string user_cn = result0: (length( result ) -3 )

string result2 = ""
string cmd2 = "dsget group -members " user_cn
win32SystemWait_ ( cmd2, result2, -1 )

string res1 = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-TestUsers -gc", res1, -1 )
string user_cn1 = res10: (length( res1 ) -3 )

string res2 = ""
string cmd3 = "dsget group -members " user_cn1
win32SystemWait_ ( cmd3, res2, -1 )
string resmg = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-DBMgr -gc", resmg, -1 )
string user_cn2 = resmg0: (length( resmg ) -3 )

string resmg2 = ""
string cmd4 = "dsget group -members " user_cn2
win32SystemWait_ ( cmd4, resmg2, -1 )

string res_ept = ""
win32SystemWait_ ( "dsquery group forestroot -name A-700-DL-APP-DOORS-ExerptUsers -gc", res_ept, -1 )
string user_cn3 = res_ept0: (length( res_ept ) -3 )

string res_ept2 = ""
string cmd5 = "dsget group -members " user_cn3
win32SystemWait_ ( cmd5, res_ept2, -1 )
Module m =current

Object o, startObj, endObj

getSelection(m,startObj, endObj)

if (!null startObj)
{

while(!null startObj && isSelected startObj)
{
o = startObj
startObj = next(startObj)

bool virtual=o."_j_virtual"
string global=o."_j_Global ID"
string h=number(o)
if (matches(global,result2))
{
o."_j_A-700-DL-APP-DOORS-Users"="1"

}
else
{

o."_j_A-700-DL-APP-DOORS-Users"="0"
}
if (matches(global,res2))
{

o."_j_A-700-DL-APP-DOORS-TestUsers"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-TestUsers"="0"
}
if (matches(global,resmg2))
{

o."_j_A-700-DL-APP-DOORS-DBMgr"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-DBMgr"="0"
}
if (matches(global,resmg2))
{

o."_j_A-700-DL-APP-DOORS-ExerptUsers"="1"
}
else
{

o."_j_A-700-DL-APP-DOORS-ExerptUsers"="0"
}
}

}
else
{
warningBox ("No object selected,please select objects")
}
Hi!! thank you for your support.I hope now the code looks readable.I agree that the progress bar is useless here.I don't see anything when i run this script.so that i removed it.But still no changes in the output.It always shows me the same error when i am selecting more then 20 objects.

When posting code:
  • type {code}
  • paste
  • type {code}
  • Use the "Preview" tab to see what it looks like.

I'm grasping at straws here, maybe go ahead and ignore this post.

You need to supply where in your program the failure occurs. In this case it is strangly NOT giving the DXL line number which makes me suspect its in the "wait.." commands. Perhaps add several:
  • infoBox("B4 Result")
  • infoBox("B4 Res1")
to narrow it down. Maybe add this at the top of your while loop:
  • print("\to = " identifier(o)

The method you use to process selected objects looks right, but I <feel> a problem with selecting objects in a hierarchy and using "next". For no good reason, please humor me and restructure your loop:
  • Object oCurr = current
  • for o in entire (m) do
  • { if (isDeleted(o)) continue
  • if (o != oCurr and !isSelected(o)) continue // We DO want just a single current object processed, yes?
  • process Object o

I wonder what happens when "matches" is used with non-ascii string? Perhaps check using
  • if (!isRichText(global))...

-Louie

Ding Ding Ding: I realize I have a nagging memory of problems associated with Attribute Names starting with "_".